package cz.muni.fi.pa165.sme.client.system;

import cz.muni.fi.pa165.sme.client.pages.ErrorPage;
import cz.muni.fi.pa165.sme.client.pages.burnedCalories.CaloriesAddPage;
import cz.muni.fi.pa165.sme.client.pages.burnedCalories.CaloriesListPage;
import cz.muni.fi.pa165.sme.client.pages.sportActivity.ActivityAddPage;
import cz.muni.fi.pa165.sme.client.pages.sportActivity.ActivityListPage;
import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;

/**
 * @author jirankova
 */
public class SportManagerClientApplication extends WebApplication {
	@Override
	public Class<? extends Page> getHomePage() {
		return ActivityListPage.class;
	}

	@Override
	protected void init() {
		super.init();

		this.getMarkupSettings().setDefaultMarkupEncoding("UTF-8");
		this.getRequestCycleSettings().setResponseRequestEncoding("UTF-8");

		getComponentInstantiationListeners().add(new SpringComponentInjector(this));

		//mount pages
		mountPage("/calories", CaloriesListPage.class);
		mountPage("/calories/add", CaloriesAddPage.class);
		mountPage("/activity", ActivityListPage.class);
		mountPage("/activity/add", ActivityAddPage.class);

		//error pages
		mountPage("/error", ErrorPage.class);
	}
}
